<template>
    <div>
        <h1>我是test组件</h1>
        <div ref="box">111</div>
        <button @click="result">变色</button>
    </div>
</template>

<script>
    export default {
        name:"test",
        methods:{
            result(){
                this.$refs.box.style.color = "red"
            }
        },
     
    }
</script>